const proxy = require('http-proxy-middleware')

module.exports = function(app){
  app.use(
    proxy('/api1',{ //api1 为分类  pathRewrite会去掉
      target:'http://rap2api.taobao.org/app/mock/255594',
      changeOrigin:true, //是否跨域
      pathRewrite:{'^/api1':''} //重写请求路径
    })
  ),
  app.use(
    proxy('/api2',{ //api1 为分类  pathRewrite会去掉
      target:'http://rap2api.taobao.org/app/mock/666666',
      changeOrigin:true,
      pathRewrite:{'^/api2':''}
    })
  )
}